package com.ifnk.portaljava.hlyt.dao;

import com.ifnk.portaljava.hlyt.beans.Module;
import com.ifnk.portaljava.hlyt.beans.Role;

import java.sql.Connection;
import java.util.List;

public interface IRoleJdbcDao {

	/**
	 * 查询所有的角色
	 * @return
	 */
	List<Role> findAll() throws Exception;
	/**
	 * 把该模块对应的权限添加到角色，即给角色添加权限
	 * @param moduleId
	 * @param roleList
	 * @param conn
	 * @throws Exception 
	 */
	void addModuleToRoles(int moduleId, String permission, Role role, Connection conn) throws Exception;
	int save(Role role, Connection conn) throws Exception;
	List findByName(String roleName) throws Exception;
	void deleteUserRole(int roleId, Connection conn) throws Exception;
	List<Role> findByUserId(int userId) throws Exception;
	List<Role> findbyRole(Role role) throws Exception;
	List findByModule(Module module) throws Exception;
	List<Role> findByUserName(String userName) throws Exception;
	void deleteRole(int roleId, Connection conn) throws Exception;
}
